package com.example.demo.auto.entityhelp;

import com.beiding.businessplatform.data.BeHelp;
import com.beiding.businessplatform.data.BeHolder;
import com.beiding.businessplatform.data.Holder;
import com.beiding.businessplatform.data.HolderMap;
import com.example.demo.auto.entity.BBe;

import java.util.HashMap;
import java.util.Map;

public class BBeHelp extends BeHelp<BBe> {

    public HolderMap createBeHolder(BeHolder<BBe> beMaker) {

        Map<String, Holder> holderMap = new HashMap<>();

        holderMap.put("id",
                new Holder() {
                    @Override
                    public Object get() {
                        return beMaker.make().getId();
                    }

                    @Override
                    public void set(Object value) {
                        beMaker.make().setId((String) value);
                    }
                }
        );

        holderMap.put("name",
                new Holder() {
                    @Override
                    public Object get() {
                        return beMaker.make().getName();
                    }

                    @Override
                    public void set(Object value) {
                        beMaker.make().setName((String) value);
                    }
                }
        );
        return new HolderMap(holderMap);
    }

}
